﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using Tinkerc.Framework.Data.Resolve;

namespace Tinkerc.Framework.Data
{
    /// <summary>
    ///  SqlServer组装查询
    /// </summary>
    public class SqlServerQuery<TEntity> : Query<TEntity> where TEntity : IEntity
    {
        /// <summary>
        /// 查询语句
        /// </summary>
        protected override string SelectSql
        {
            get
            {
                var sqlStr = base.SelectSql;

                 if (base.TopNum > 0)
                 {
                     sqlStr = string.Format("SELECT TOP {0} {1} FROM {2} {3} ", TopNum, base.SelectColumn, this._ModelDes.TableName, this.WhereSql);
                 }

                return sqlStr;
            }
        }
    }
}
